
# 插入proto目录到sys.path
from dji_redis.redis_client import RedisClient
from business.business_constant import BusinessConstant

class callbackManager:
    redis_client = RedisClient()

    def handle(self, payload):
        raise NotImplementedError("子类必须实现handle方法")

    # 发布指令回调日志
    def publish_callback_message(self, message):
        self.redis_client.lpush(BusinessConstant.SERVICES_REPLY_LOG_KEY,
                           message,
                           BusinessConstant.MESSAGE_LIMIT)

    # 发布设备上报信息
    def publish_dev_up_message(self, message):
        self.redis_client.lpush(BusinessConstant.SERVICES_REPLY_LOG_KEY,
                           message,
                           BusinessConstant.MESSAGE_LIMIT)